/*
 * @Description: jishupu-admin-template
 * @Author: 技术铺<jishupu@qq.com>
 * @Date: 2022-03-03
 */
const { success } = require('./utils')

// 广告模块
module.exports = [
  {
    url: '/v1/ads-space/\\d+/ads$',
    type: 'get',
    response: config => {
      const result = {
        'items': [
          {
            'id': 6,
            'space_id': 2,
            'name': 'vuejs渐进式 JavaScript 框架',
            'cover_image': [
              {
                'id': 4,
                'name': 'Snipaste_2022-02-28_14-45-35.png',
                'description': '',
                'path': '/static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png',
                'url': 'http://localhost:9527/static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png'
              }
            ],
            'href': '',
            'href_target': '_self',
            'rel': '',
            'partner': '',
            'partner_linkman': '',
            'partner_phone_number': '',
            'description': '',
            'cast_period': 1,
            'start_time': '',
            'end_time': '',
            'sort': 1,
            'status': 1,
            'created_at': '2022-02-28 14:48:01',
            'updated_at': '2022-02-28 14:48:01'
          }
        ],
        'meta': {
          'current_page': 1,
          'last_page': 1,
          'per_page': '20',
          'total': 1
        }
      }
      return success(result)
    }
  },
  {
    url: '/v1/ads-space/\\d+/ads/\\d+$',
    type: 'get',
    response: config => {
      const result = {
        'id': 6,
        'space_id': 2,
        'name': 'vuejs渐进式 JavaScript 框架',
        'cover_image': [
          {
            'id': 4,
            'name': 'Snipaste_2022-02-28_14-45-35.png',
            'description': '',
            'path': '/static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png',
            'url': 'http://localhost:9527/static/img/demo/6QdvsDuKqPX1WfdqDnKkB58bf05ANzXEZHf5KXsE.png'
          }
        ],
        'href': '',
        'href_target': '_self',
        'rel': '',
        'partner': '',
        'partner_linkman': '',
        'partner_phone_number': '',
        'description': '',
        'cast_period': 1,
        'start_time': '',
        'end_time': '',
        'sort': 1,
        'status': 1
      }
      return success(result)
    }
  },
  // 添加
  {
    url: '/v1/ads-space/\\d+/ads$',
    type: 'post',
    response: config => {
      return success({}, '添加成功')
    }
  },
  // 修改
  {
    url: '/v1/ads-space/\\d+/ads/\\d+$',
    type: 'put',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟排序
  {
    url: '/v1/ads-space/\\d+/ads/sort',
    type: 'put',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟修改状态
  {
    url: '/v1/ads-space/\\d+/ads/\\d+/status',
    type: 'patch',
    response: config => {
      return success({}, '修改成功')
    }
  },
  // 模拟删除
  {
    url: '/v1/ads-space/\\d+/ads/\.*',
    type: 'delete',
    response: config => {
      return success({}, '删除成功')
    }
  }
]
